package com.hjms.platformapplet.controller;

import com.hjms.account.contracts.dto.account.AddAccountDto;
import com.hjms.account.contracts.vo.account.AccountVo;
import com.hjms.account.share.IAccountFeignService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 何杨谊
 * @description: TODO
 * @date 2022/12/30 17:58
 */
@Api(tags = "账号")
@RestController
@RequestMapping("/api/account")
public class AccountController {
    @Autowired
    private IAccountFeignService accountService;

    /**
     * 新增账号
     * @param dto
     * @return
     */
    @PostMapping
    @ApiOperation(value = "新增账号")
    public String Add(@RequestBody AddAccountDto dto){
        return accountService.Add(dto);
    }

    /**
     * 获取账号
     * @param accountId
     * @return
     */
    @GetMapping("{accountId}")
    @ApiOperation(value = "获取账号信息")
    public AccountVo Get(@PathVariable(value ="accountId" ) String accountId){return  accountService.Get(accountId);}
}